Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Aging Effects to Include Clan Reputation Modifiers & Glass Jaw Gain #6575

Merged
merged 6 commits into from
Apr 12, 2025

Conversation

IllianiBird
Copy link
Collaborator

@IllianiBird IllianiBird commented Apr 7, 2025

Requirements

Requires #6607

Dev Notes

This PR expands our aging implementation to inflict Glass Jaw & Slow Learner on characters whenever they hit certain milestones. As per RAW this SPA gain is inflicted every valid milestone. So while the character can mitigate it with repeated purchases of the Toughness and Quick Learner SPAs, but that gets expensive quick.

I also went and implemented Reputation penalties for non-blood named characters in Clan Campaigns once they hit specific Milestones. This required refactoring how Reputation is fetched, which also exposed a couple of minor bugs which I cleaned up as I went.

- Replaced direct access to `Person.getReputation()` with `getAdjustedReputation()` for better handling of age, clan affiliation, and campaign options.
- Introduced `applyAgingSPA()` and `getReputationAgeModifier()` for age-related effects and reputation adjustments.
- Simplified and optimized existing logic for skill and reputation calculations.
- Introduced `isClanCampaign()` to determine clan-based campaign properties.
- Fixed formatting inconsistencies in Resupply class documentation.
- Replaced direct access to `Person.getReputation()` with `getAdjustedReputation()` for better handling of age, clan affiliation, and campaign options.
- Introduced `applyAgingSPA()` and `getReputationAgeModifier()` for age-related effects and reputation adjustments.
- Simplified and optimized existing logic for skill and reputation calculations.
- Introduced `isClanCampaign()` to determine clan-based campaign properties.
- Fixed formatting inconsistencies in Resupply class documentation.
@IllianiBird IllianiBird added Bug Refactoring Severity: Low Issues described as low severity as per the new issue form Implementation of Missing Official Rule Used with the RFE tag for the implementation of missing official rule labels Apr 7, 2025
@IllianiBird IllianiBird self-assigned this Apr 7, 2025
…putation(boolean, boolean, LocalDate, int)` instead of the outdated one.
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 103 lines in your changes missing coverage. Please review.

Project coverage is 11.42%. Comparing base (2e3759c) to head (f272e44).
Report is 36 commits behind head on master.

Files with missing lines Patch % Lines
...kHQ/src/mekhq/campaign/personnel/skills/Aging.java 0.00% 31 Missing ⚠️
MekHQ/src/mekhq/gui/model/CrewListModel.java 0.00% 17 Missing ⚠️
MekHQ/src/mekhq/gui/view/PersonViewPanel.java 0.00% 11 Missing ⚠️
...ampaign/personnel/skills/enums/AgingMilestone.java 0.00% 9 Missing ⚠️
...src/mekhq/gui/enums/PersonnelTableModelColumn.java 0.00% 8 Missing ⚠️
...ampaign/rating/CamOpsReputation/CommandRating.java 0.00% 7 Missing ⚠️
...q/campaign/mission/resupplyAndCaches/Resupply.java 0.00% 5 Missing ⚠️
.../mekhq/gui/adapter/PersonnelTableMouseAdapter.java 0.00% 5 Missing ⚠️
MekHQ/src/mekhq/campaign/Campaign.java 0.00% 4 Missing ⚠️
MekHQ/src/mekhq/campaign/personnel/Person.java 0.00% 4 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6575      +/-   ##
============================================
+ Coverage     11.41%   11.42%   +0.01%     
+ Complexity     6475     6468       -7     
============================================
  Files          1093     1089       -4     
  Lines        140531   140272     -259     
  Branches      21792    21761      -31     
============================================
- Hits          16037    16033       -4     
+ Misses       122855   122600     -255     
  Partials       1639     1639              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@IllianiBird
Copy link
Collaborator Author

This PR now requires #6574 && #6605

# Conflicts:
#	MekHQ/src/mekhq/campaign/personnel/Person.java
@IllianiBird IllianiBird merged commit 373414f into MegaMek:master Apr 12, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Implementation of Missing Official Rule Used with the RFE tag for the implementation of missing official rule Refactoring Severity: Low Issues described as low severity as per the new issue form
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants